home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / programr / listings / ptv2n5 / dlscheck.asm < prev    next >
Assembly Source File  |  1991-09-17  |  1KB  |  34 lines

  1. CSeg    segment
  2. assume  cs:CSeg,ds:CSeg,es:nothing
  3.         org     100h
  4. Begin:  mov     ah,2ah  ; Get the system date.
  5.         int     21h
  6. ; DH=Month; DL=Day; AL=Day-of-week (Sun=0 etc.).
  7.         add     al,24   ; For last Sun check.
  8.         cmp     dh,4    ; Check for April.
  9.         jl      Exit00  ; Standard time.
  10.         je      AprCK   ; It's April, check Sun.
  11. OcbCK:  cmp     dh,10   ; Check for October.
  12.         jg      Exit00  ; Standard time.
  13.         jl      Bump    ; Daylight savings.
  14.         xchg    dl,al   ; Swap compare for October.
  15. AprCK:  cmp     dl,al   ; Last Sunday check.
  16.         jl      Exit00  ; Standard time.
  17. ; Adjust for daylight savings time here.
  18. Bump:   mov     ax,40h  ; Bump system time ahead
  19.         mov     es,ax   ;  65543 counts (1 hour).
  20.         cli             ; Do the deed without ticks.
  21.         add     word ptr es:[6ch],7
  22.         adc     word ptr es:[6eh],1
  23. ; Check for 24 hour rollover.
  24.         cmp     word ptr es:[6eh],24
  25.         jl      Exit00
  26.         cmp     word ptr es:[6ch],168
  27.         jb      Exit00
  28. ; Set the overflow and rollover the counts.
  29.         mov     byte ptr es:[70h],1
  30.         sub     word ptr es:[6ch],168
  31.         mov     word ptr es:[6eh],0
  32. Exit00: int     20h
  33. CSeg    ends
  34.         end     Begin